<?php

namespace App\Admin\Controllers;

use App\Models\Inspection;
use Encore\Admin\Controllers\AdminController;
use Encore\Admin\Form;
use Encore\Admin\Grid;
use Encore\Admin\Show;

class InspectionsController extends AdminController
{
    protected $title = 'Inspection';
    
    protected function grid()
    {
        $grid = new Grid(new Inspection());

        $grid->column('id', 'ID');
        $grid->column('route', '路由');
        $grid->column('action', '操作');
        $grid->column('reason', '事由');
        $grid->column('ip', 'IP');
        $grid->column('country', '国家');
        $grid->column('state', '省份');
        $grid->column('city', '城市');
        $grid->column('lat', '纬度');
        $grid->column('lon', '经度');
	    $grid->column('created_at', '时间')->display(function () {
		    return (string)$this->created_at;
	    });
	
	    $grid->disableRowSelector();
	    $grid->disableCreateButton();
	    $grid->disableExport();
	    $grid->disableActions();

        return $grid;
    }
}
